home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / system-config-printer / troubleshoot / QueueRejectingJobs.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2009-10-28  |  2KB  |  58 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import cups
  5. from base import *
  6.  
  7. class QueueRejectingJobs(Question):
  8.     
  9.     def __init__(self, troubleshooter):
  10.         Question.__init__(self, troubleshooter, 'Queue rejecting jobs?')
  11.         solution = gtk.VBox()
  12.         solution.set_border_width(12)
  13.         solution.set_spacing(12)
  14.         label = gtk.Label('<span weight="bold" size="larger">' + _('Queue Rejecting Jobs') + '</span>')
  15.         label.set_alignment(0, 0)
  16.         label.set_use_markup(True)
  17.         solution.pack_start(label, False, False, 0)
  18.         self.label = gtk.Label()
  19.         self.label.set_alignment(0, 0)
  20.         self.label.set_line_wrap(True)
  21.         solution.pack_start(self.label, False, False, 0)
  22.         solution.set_border_width(12)
  23.         troubleshooter.new_page(solution, self)
  24.  
  25.     
  26.     def display(self):
  27.         answers = self.troubleshooter.answers
  28.         if not answers['cups_queue_listed']:
  29.             return False
  30.         if answers['is_cups_class']:
  31.             queue = answers['cups_class_dict']
  32.         else:
  33.             queue = answers['cups_printer_dict']
  34.         rejecting = queue['printer-type'] & cups.CUPS_PRINTER_REJECTING
  35.         if not rejecting:
  36.             return False
  37.         if answers['cups_printer_remote']:
  38.             attrs = answers['remote_cups_queue_attributes']
  39.             reason = attrs['printer-state-message']
  40.         else:
  41.             reason = queue['printer-state-message']
  42.         text = _("The queue '%s' is rejecting jobs.") % answers['cups_queue']
  43.         if reason:
  44.             text += ' ' + _("The reason given is: '%s'.") % reason
  45.         
  46.         if not answers['cups_printer_remote']:
  47.             text += '\n\n'
  48.             text += _("To make the queue accept jobs, select the 'Accepting Jobs' checkbox in the 'Policies' tab for the printer in the printer administration tool.") + ' ' + TEXT_start_print_admin_tool
  49.         
  50.         self.label.set_text(text)
  51.         return True
  52.  
  53.     
  54.     def can_click_forward(self):
  55.         return False
  56.  
  57.  
  58.